package ken.spring.cloud.alibaba.config;

import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <ul>
 * <li>Title: MyBalanceRule</li>
 * <li>Description: TODO </li>
 * </ul>
 *
 * @author swc
 * @date 2022-06-28 9:53
 */
//配置负载均衡的策略
@Configuration
public class MyBalanceRule {

    @Bean
    public IRule myRule(){
        return  new WeightedResponseTimeRule();
    }
}
